
<script type="text/javascript">
	function submit()
	{
		$("#frmNews").submit();
		}
 </script>
<form method="post"
	action="<?php echo $this->url(array("action"=>"index")) ?>" name="form"
	id="frmNews">
	<!-- Filter Panel -->
	<div id="filter-panel" class="ui-corner-all ui-widget-content">
		<span>Filter by status:</span> <label for="filter1">Actived</label> <input
			type="checkbox" name="filter1" value="" id="filter1" /> <label
			for="filter2">Pending</label> <input type="checkbox" name="filter1"
			value="" id="filter2" /> <label for="filter3">Scheduled</label> <input
			type="checkbox" name="filter1" value="" id="filter3" /> <label
			for="filter4">UnActived</label> <input type="checkbox" name="filter1"
			value="" id="filter4" />
	</div>
	<!-- End Filter Panel -->

	<!-- Sorting Panel -->
	<div id="sort-panel">
		<span class="bold">Sort By:</span> <select name="sortinga">
			<option value="0">Choose a type</option>
			<option value="1">Name</option>
			<option value="2">Status</option>
		</select>
	</div>

	<div id="sort-panel">
		<span class="bold">Search By Status:</span> <select name="sorting"
			onchange="submit();">
			<option value="99999">Choose a type</option>
			<option value="1">Hiá»ƒn thá»‹</option>
			<option value="0">KhÃ´ng hiá»ƒn thá»‹</option>
		</select>
	</div>
	<div id="sort-panel">
		<span class="bold">Search By Category:</span> <select name="sortIntro"
			onchange="submit();">
			<option value="0">Tất cả</option>
			<?php $modelCate = new Default_Model_DbTable_Category();
				$cate = $modelCate->getAllCategory();
			?>
			<?php foreach ($cate as $c):?>
						<option value="<?php echo $c["ID"]?>"><?php echo $c["CAT_NAME"]?></option>
			<?php endforeach;?>
		</select>
	</div>
	<!-- End Sorting Panel -->
	
	<div class="clear"></div>
	<!-- Clear floatting -->

	<!-- New Page Button -->
	<div style="margin: 10px 0px 20px 10px">
		<a href="<?php echo $this->url(array("action"=>"add"))?>"
			class="submit button large ui-corner-all">Thêm mới</a>
	</div>
	<!-- END New Page Button -->

	<table class="list-table">
		<thead>
			<tr>
				<th>ID</th>
				<th>Tiêu đề</th>
				<th>Mô tả ngắn</th>
				<th>Danh mục tin</th>
				<th>Ngày đăng</th>
				<th>Cập nhật lúc</th>
				<th>Hình ảnh</th>
				<th>Trạng thái</th>
				<th colspan="4">Chỉnh sửa</th>
			</tr>
		</thead>
		<tbody>
                <?php foreach ($this->allNews as $n){?>
                	<tr>
				<td><?php echo $n["id"]?></td>
				<td><?php echo "<a href=".$this->url(array("action"=>"edit","id"=>$n["ID"])).">".$n["TITLE"]."</a>";?></td>
				<td><?php echo $n["SHORT_CONTENT"]?></td>
				<td><?php echo $n["CATEGORY_ID"]?></td>
				<td><?php echo $n["ADMIN_ID"]?></td>
				<td><?php echo date("d-m-Y",strtotime($n["UPDATE"]))?></td>
				<td><img height="100" width="100" src="<?php echo $n["IMG"]?>" /></td>
                        <?php if($n["STATUS"] == 1){?>
                        <td><a
					href="<?php echo $this->url(array("action"=>"active","id"=>$n["id"]))?>"><span
						class="button submit medium green-back fixed-width-100 ui-corner-all">Actived</span></a></td>
                        <?php }else{?>
                        <td><a
					href="<?php echo $this->url(array("action"=>"active","id"=>$n["id"]))?>"><span
						class="button submit medium green-back fixed-width-100 ui-corner-all">No
							Actived</span></a></td>
                        <?php }?>
                        <td><a
					href="<?php echo $this->url(array("action"=>"edit","id"=>$n["id"]))?>"
					class="edit-record">Chỉnh sửa</a></td>
				<td><a
					href="<?php echo $this->url(array("action"=>"del","id"=>$n["id"]))?>"><img
						src="<?php echo $this->baseUrl()?>/public/images/icons/delete.png">Xóa</a></td>
			</tr>
                    <?php }?>
                </tbody>
	</table>
</form>
<hr />
<!-- Divider -->

<!-- Pagination -->
<div id="pagination">
            	<?php echo $this->paginationControl($this->allNews,"Sliding","pagination.phtml")?>
           </div>
<!-- End Pagination -->